﻿using System;
using System.Linq;
using System.Web;
using Enyim.Caching;
using System.Web.Mvc;
using SilenthinkContract;
using SilenthinkContract.Util;
using SilenthinkContract.Domain;
using SilenthinkCommon.Extension;
using SilenthinkContract.Component;

namespace Web.Controllers
{
    public class HomeController : BaseController
    {
        public HomeController(ILogService logService, IBaseService baseService, IExtraService extraService, IStoreService storeService, IOrderService orderService, IGameService gameService, IAuctionService auctionService, IPassportService passportService, IPaymentService paymentService, IMemcachedClient memcachedClient) : base(logService, baseService, extraService, storeService, orderService, gameService, auctionService, passportService, paymentService, memcachedClient)
        {
        }

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Indexs()
        {
            //var categories = MemcachedClient.Put(CacheKey.Store.ProductCategory, () => StoreService.GetProductCategory().ToList());
            //var tree = new TreeFactory<ProductCategory>().CreateTreeByLevel(categories);
            return View();
        }

        public ActionResult Slide()
        {
            return PartialView();
        }

        public ActionResult AvatarTest()
        {
            return View();
        }
        [HttpPost]
        public void AvatarTest(HttpPostedFileBase bigFileName)
        {
            var s = bigFileName;
            s.SaveAs(Server.MapPath("/StaticHtml/a.jpg"));

        }

        public ActionResult UploaderTest()
        {
            return View();
        }

        public ActionResult Captcha()
        {
            return Captcha("dddd");
        }

        public ActionResult Comet()
        {
            return View();
        }

        public ActionResult Test()
        {
            var s = Request.QueryString.AsDynamic();
            var a = s.UserName;
            return Content(a);
        }

    }
}
